#pragma once

#include <stddef.h>
#include <string>
#include "util/noncopyable.h"
namespace net_tools
{
    class Config : util::noncopyable
    {
    public:
        Config(std::string appname = "DEFAULT_NAME");
        ~Config(){};
        void Analyze(const std::string &address);
        // 每一层B+树的数据个数
        static const int DEFAULT_BPLUSTREE_SIZE = 100;
        // 心跳系统的心跳次数
        static const int HEARTBEAT_VECTOR_SIZE = 20;
        // log单次最大长度
        static const int SET_LOG_ONE_LOG_MAX_SIZE = 10240;
        // 每个线程的log缓冲区的大小
        static const int SET_LOG_BUFFER_SIZE = (1024 * 1024 * 50);
        // cpu内核核心个数位数
        static const int CORE_NUMBER_BIT = 3;

        static std::string APP_NAME;
        static std::string IP_ADDRESS;
        static int EACH_NEW_CHANNEL;
        static int CHANNEL_DEFAULT_SIZE;
        static int DEFAULT_WAKEUP_VECTOR_SIZE;
        static int MAX_WAIT_ACCEPT;
        static int DEFAULT_PORT;
        static int CONNECT_POOL_DEFAULT_SIZE;
        static int EACH_NEW_CONNECT;
        static int HEARTBEAT_EVERY_SEC;
        static int HEARTBEAT_EVERY_USEC;
        static int SET_LOG_FLUSH_SEC;
        static int SET_LOG_FLUSH_USEC;
        static int SET_LOG_HIGHLEVEL;
        static size_t SET_LOG_SET_FILE_MAX_SIZE;
        static int SET_LOG_FMT_MAX_LEN;
        static int MAX_CONNECT_NUMBER;
        static int HIGH_CPU_LOADAVG;
        static unsigned int NET_BUFFER_LENDATA_SIZE;
        static int BUFFER_MEMPOOL_BLOCK_SIZE;
        static int BUFFER_MEMPOOL_BLOCK_NUMBER;
        static int WORK_THREAD_POOL_SIZE;
        static int WORK_THREAD_POOL_QUEUE_SIZE;
        static int SET_LOG_OUTPUT_LEVEL;
        static int BUFFER_ONCE_WRITE_CALLBACK_IOVEC_SIZE;
        static int BUFFER_ONCE_READ_CALLBACK_IOVEC_SIZE;
        static int CLIENT_HEART_BEAT_EVERY_SEC;

        static int EPOLL_FOREVER;
        static int TIMEJOB_FOREVER;

    private:
    };

#define _C net_tools::Config

} // namespace net_tools